﻿using Cloud.Core.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Cloud.Core.AuthUser
{
    public class Character
    {
        public string UserName { get; set; }

        public string PassWord { get; set; }

        public bool IsLogin { get; set; }

        public class PowerList
        {
            /// <summary>
            /// 用户管理
            /// </summary>
            public Power MUser { get; set; } = new Power();
            /// <summary>
            /// 计划模块
            /// </summary>
            public Power MPlan { get; set; } = new Power();
            /// <summary>
            /// 合同模块
            /// </summary>
            public Power MContract { get; set; } = new Power();
            /// <summary>
            /// 日志模块
            /// </summary>
            public Power MLog { get; set; } = new Power();
            /// <summary>
            /// 基础信息
            /// </summary>
            public Power MBasicInfo { get; set; } = new Power();
            /// <summary>
            /// 数据报表
            /// </summary>
            public Power MDataTable { get; set; } = new Power();
            /// <summary>
            /// 过磅数据
            /// </summary>
            public Power MGuoBang { get; set; } = new Power();
            /// <summary>
            /// 系统参数
            /// </summary>
            public Power MSysParam { get; set; } = new Power();

            public void SetPower(User UserInfo)
            {
                //MBasicInfo.InPutPower(UserInfo.UserBsicdata);
                //MContract.InPutPower(UserInfo.UserContact);
                //MDataTable.InPutPower(UserInfo.UserlDatatable);
                //MGuoBang.InPutPower(UserInfo.UserGuobang);
                //MLog.InPutPower(UserInfo.UserLog);
                //MPlan.InPutPower(UserInfo.UserPlan);
                //MSysParam.InPutPower(UserInfo.UserSystem);
                //MUser.InPutPower(UserInfo.UserUser);
            }
        }

        public PowerList PowerValue { get; set; }

        public DateTime StartTime { get; set; }
        
        public DateTime EndTime { get; set; }

        public Character()
        {
            IsLogin = false;
            PowerValue = new PowerList();
        }
    }
}
